const router = require('koa-router')() // 一边导入一边实例化
// const result = require('../../config/result.js')
// const { regcheck,checking } = require('../../config/checking.js')
// const bodyParser = require('koa-bodyparser')
// 操作数据库的接口
const { getToken, Deleteurl } = require('../../config/databaseapi.js')
// 注册接口
router.post('/deleteuserlist', async (ctx) => {
	console.log('调用删除党员信息接口');
	let { _id } = ctx.request.body
	let query = `db.collection("member_info").where({_id:"${_id}"}).remove()`;
	let res = await new getToken().posteve(Deleteurl, query);
	if (res.errcode === 0) {
		ctx.body = { msg: "删除成功", status: 1 }
	} else {
		ctx.body = { msg: "删除失败", status: 0 }
	}
})

module.exports = router.routes();